
#include "stdafx.h"
#include "../Utilities/utilities.h"
#include "Globals.h"
#include "Game.h"
#include "MenuState.h"
#include "StateTest.h"
#include "Marco.h"
#include <conio.h>
#include <time.h>  

int _tmain(int argc, _TCHAR* argv[])
{
	//identifying memory leaks
	_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); 
	ESContext esContext;
	
	Game* mainGame = Game::GetInstance(&esContext);
	
	if (mainGame->CreateGame() == 0)
	{
		delete Globals::currentCamera;
		Delete(mainGame);
		printf("%s", "Error!");
		_getch();
		return 0;
	}

	StateManager* stateManager = StateManager::GetInstance();
	MenuState* menuState = new MenuState();
	//StateTest* newState = new StateTest();
	mainGame->AddState(menuState);
	//mainGame->AddState(newState);
	stateManager->currentState = menuState;

	mainGame->StartGame();
	
	delete Globals::currentCamera;
	Delete(mainGame);
	
	//_getch();

	return 0;
}

